package com.shqcjd.sinopecdemomobile.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.sinopecdemomobile.R;
import com.shqcjd.sinopecdemomobile.model.pojo.RouteListBean;
import com.shqcjd.sinopecdemomobile.util.Glideutil;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class InspectionAdapter extends BaseQuickAdapter<RouteListBean.ItemsBean,InspectionAdapter.ViewHolder> {
    private Context context;

    public InspectionAdapter(@Nullable List<RouteListBean.ItemsBean> data, Context context) {
        super(R.layout.item_inspection, data);
        this.context = context;
    }

    @Override
    protected void convert(InspectionAdapter.ViewHolder helper, RouteListBean.ItemsBean item) {
        helper.tvItemInspectionName.setText(item.name);
        helper.tvItemInspectionContent.setText(item.lastpatrolinfo);
        helper.tvItemInspectionLIocation.setText(item.area+">"+item.group+">"+item.factory+">"+item.branch_factory);
        Glideutil.loadImag(context,helper.ivItemInspection,item.img);
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.tv_item_inspection_name)
        TextView tvItemInspectionName;
        @BindView(R.id.tv_item_inspection_content)
        TextView tvItemInspectionContent;
        @BindView(R.id.tv_item_inspection_location)
        TextView tvItemInspectionLIocation;
        @BindView(R.id.iv_item_inspection)
        ImageView ivItemInspection;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }

}
